
A Case of the Pemba Channel
Invalid Date
Part I–Theory, data & Results
Part II–Application
Synopsis
The WIO region is located
Latitude 30oS – 15oN
Longitude 25oE – 70oE
It has unique ocean circulation patterns

The four major geomorphology features are:





Patterns of surface circulation in the WIO region was produced from;
The study used drifter data to estimate surface current in the the WIO region. The specific objectives are;


\[ \phi = \sqrt{(u^2 + v^2)} \]
Where: \(\phi\) = Estimated velocity; \(v^2\) = meridional velocity field; \(u^2\) = zonal velocity field
\[ KE = \frac{1}{2} \times \rho [u^2+v^2] \]
Where: \(\phi\) = Estimated velocity; \(v^2\) = meridional velocity field; \(u^2\) = zonal velocity field
\[ EKE =\frac{1}{2} \times \rho [(u - \bar u)^2+(v-\bar v)^2] \]
Where: \(\phi\) = Estimated velocity; \(v^2\) = meridional velocity field; \(u^2\) = zonal velocity field, \(\bar u\) and \(\bar v\) are zonal and meridional mean velocity
Access Data
mur.monthly.sst = wior::get_sstMUR(
lon.min = 38.5, lon.max = 41,
lat.min = -6.0, lat.max = -3.5,
t1 = "2016-01-01", t2 = "2018-01-01",
level = 2
)
sst.monthly = mur.monthly.sst %>%
filter(
time > lubridate::dmy(010116) &
time < lubridate::dmy(010117) &
between(longitude, 38.8,40) &
between(latitude,-6,-4.1)
) %>%
mutate(
miezi = lubridate::month(
time, abbr = TRUE, label = TRUE)
) %>%
select(-c(mask, nobs))Determine Index
lat.unique = sst.monthly %>%
distinct(latitude) %>% pull
month.unique = sst.monthly %>%
distinct(miezi) %>% pull() %>%
as.character()
sst.upwelling = list()
seq.miezi = seq(1000,12000,1000)
for (i in 1:length(lat.unique)){
for (j in 1:length(month.unique)){
sst.upwelling[[i+seq.miezi[j]]] = sst.monthly %>%
filter(
latitude == lat.unique[i] &
miezi == month.unique[j]
) %>%
mutate(
sst.anomaly = sst - median(sst, na.rm = TRUE)
)
}
}Random Forest
library(tidymodels)
# Load the dataset
data(model.data)
# Split the data into training and testing sets
set.seed(123)
split <- initial_split(model.data, prop = 0.8, strata = "months")
train_data <- training(split)
test_data <- testing(split)
# Define the recipe for preprocessing the data
rf_recipe <- recipe(mpg ~ ., data = train_data) %>%
step_normalize(all_predictors())
# Define the model specification
rf_spec <- rand_forest(
mtry = tune(),
trees = 500,
min_n = 5
) %>%
set_engine("ranger") %>%
set_mode("regression")
# Define the workflow and tune the hyperparameters
rf_workflow <- workflow() %>%
add_recipe(rf_recipe) %>%
add_model(rf_spec)
rf_results <- rf_workflow %>%
tune_grid(
resamples = bootstraps(train_data, times = 5),
grid = 10,
metrics = metric_set(rmse, rsq),
control = control_grid(verbose = TRUE)
)
# Select the best model based on RMSE
best_rf <- rf_results %>%
select_best("rmse")
# Evaluate the model on the testing set
rf_predictions <- predict(best_rf, test_data) %>%
bind_cols(test_data) %>%
metrics(truth = mpg, estimate = .pred)
# Print the RMSE and R-squared values
rf_predictions %>%
select(.metric, .estimate) %>%
pivot_wider()Linear regression
library(tidymodels)
# Load the dataset
data(model.data)
# Split the data into training and testing sets
set.seed(123)
split <- initial_split(model.data, prop = 0.8, strata = "months")
train_data <- training(split)
test_data <- testing(split)
# Define the recipe for preprocessing the data
lr_recipe <- recipe(mpg ~ ., data = train_data) %>%
step_normalize(all_predictors())
# Define the model specification
lr_spec <- linear_reg() %>%
set_engine("lm") %>%
set_mode("regression")
# Define the workflow and fit the model
lr_workflow <- workflow() %>%
add_recipe(lr_recipe) %>%
add_model(lr_spec)
lr_fit <- lr_workflow %>%
fit(train_data)
# Evaluate the model on the testing set
lr_predictions <- predict(lr_fit, test_data) %>%
bind_cols(test_data) %>%
metrics(truth = mpg, estimate = .pred)
# Print the RMSE and R-squared values
lr_predictions %>%
select(.metric, .estimate) %>%
pivot_wider()The chapter presents key results of surface current inferred from the existing drifter data
What is density of drifter along surface current pathways?

The objective of this chapter was to explore the influence of surface current inferred from drifter’s observation on;

Linear regression
library(tidymodels)
# Load the dataset
data(model.data)
# Split the data into training and testing sets
set.seed(123)
split <- initial_split(model.data, prop = 0.8, strata = "months")
train_data <- training(split)
test_data <- testing(split)
# Define the recipe for preprocessing the data
lr_recipe <- recipe(mpg ~ ., data = train_data) %>%
step_normalize(all_predictors())
# Define the model specification
lr_spec <- linear_reg() %>%
set_engine("lm") %>%
set_mode("regression")
# Define the workflow and fit the model
lr_workflow <- workflow() %>%
add_recipe(lr_recipe) %>%
add_model(lr_spec)
lr_fit <- lr_workflow %>%
fit(train_data)
# Evaluate the model on the testing set
lr_predictions <- predict(lr_fit, test_data) %>%
bind_cols(test_data) %>%
metrics(truth = mpg, estimate = .pred)
# Print the RMSE and R-squared values
lr_predictions %>%
select(.metric, .estimate) %>%
pivot_wider()Random Forest
library(tidymodels)
# Load the dataset
data(model.data)
# Split the data into training and testing sets
set.seed(123)
split <- initial_split(model.data, prop = 0.8, strata = "months")
train_data <- training(split)
test_data <- testing(split)
# Define the recipe for preprocessing the data
rf_recipe <- recipe(mpg ~ ., data = train_data) %>%
step_normalize(all_predictors())
# Define the model specification
rf_spec <- rand_forest(
mtry = tune(),
trees = 500,
min_n = 5
) %>%
set_engine("ranger") %>%
set_mode("regression")
# Define the workflow and tune the hyperparameters
rf_workflow <- workflow() %>%
add_recipe(rf_recipe) %>%
add_model(rf_spec)
rf_results <- rf_workflow %>%
tune_grid(
resamples = bootstraps(train_data, times = 5),
grid = 10,
metrics = metric_set(rmse, rsq),
control = control_grid(verbose = TRUE)
)
# Select the best model based on RMSE
best_rf <- rf_results %>%
select_best("rmse")
# Evaluate the model on the testing set
rf_predictions <- predict(best_rf, test_data) %>%
bind_cols(test_data) %>%
metrics(truth = mpg, estimate = .pred)
# Print the RMSE and R-squared values
rf_predictions %>%
select(.metric, .estimate) %>%
pivot_wider()
The objective of this chapter were to determine;




Figure 1: Upwelling events in the Pemba Channel for a) a longer period 2010 to 2020 and b) a shorter period between September 2017 and July 2020


winds blow from Indian subcontinent towards the tropical south-western Indian Ocean
reversed trade winds blow generally from tropical western Indian Ocean toward the Indian subcontinent
refers to the period of time between the end of one monsoon season and the beginning of the next.
http://www.aviso.oceanobs.com/duacs/
Moderate Resolution Imaging Spectroradiometer